﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shared.Master" AutoEventWireup="true"
    CodeBehind="contacts.aspx.cs" Inherits="Lawyer.Web.contacts" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script type="text/javascript">
        $(document).ready(function() {
            $('#slider').slidernav();

            $('.isotope-contacts').isotope({
                layoutMode: 'cellsByRow',
                cellsByRow: {
                    columnWidth: 286
                },
                getSortData: {
                    fullname: function($elem) {
                        return $elem.find('.fullname').text();
                    },
                    name: function($elem) {
                        return $elem.find('.name').text();
                    },
                    bday: function($elem) {
                        return $elem.find('.bday').text();
                    }
                },
                filter: $('input[name=index]:checked').val()
            });

            $('#isotope-contacts-filter input[name="index"]').change(function() {
                var base = this;
                setTimeout(function() { $('.isotope-contacts').isotope({ filter: $(base).val() }); }, 500);
            });
            $('#isotope-contacts-filter input[name="sort"]').change(function() {
                var base = this;
                setTimeout(function() { $('.isotope-contacts').isotope({ sortBy: $(base).val() }); }, 500);
            });

        });
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContent" runat="server">
    <div class="main-content">
        <header>
                            <ul class="action-buttons clearfix">
                                <li><a href="customadd.aspx" class="button" >New Contacts</a></li>
                            </ul>
                            <h2>
                                My Contacts
                            </h2>
                        </header>
        <section class="container_6 clearfix">                           
                            <div class="grid_6">
                                <div class="portlet">
                                    <header>
                                        <h2>Sortable Contacts</h2>
                                    </header>
                                    <div id="isotope-contacts-filter" class="ui-widget-header ui-state-default clearfix">
                                        <span class="buttonset" id="isotope-contacts-index">
                                            <input type="radio" name="index" id="index-a" value=".index-a" checked="checked"><label for="index-a">A</label>
                                            <input type="radio" name="index" id="index-b" value=".index-b"><label for="index-b">B</label>
                                            <input type="radio" name="index" id="index-c" value=".index-c"><label for="index-c">C</label>
                                            <input type="radio" name="index" id="index-d" value=".index-d"><label for="index-d">D</label>
                                            <input type="radio" name="index" id="index-e" value=".index-e"><label for="index-e">E</label>
                                            <input type="radio" name="index" id="index-f" value=".index-f"><label for="index-f">F</label>
                                            <input type="radio" name="index" id="index-g" value=".index-g"><label for="index-g">G</label>
                                            <input type="radio" name="index" id="index-h" value=".index-h"><label for="index-h">H</label>
                                            <input type="radio" name="index" id="index-i" value=".index-i"><label for="index-i">I</label>
                                            <input type="radio" name="index" id="index-j" value=".index-j"><label for="index-j">J</label>
                                            <input type="radio" name="index" id="index-k" value=".index-k"><label for="index-k">K</label>
                                            <input type="radio" name="index" id="index-l" value=".index-l"><label for="index-l">L</label>
                                            <input type="radio" name="index" id="index-m" value=".index-m"><label for="index-m">M</label>
                                            <input type="radio" name="index" id="index-n" value=".index-n"><label for="index-n">N</label>
                                            <input type="radio" name="index" id="index-o" value=".index-o"><label for="index-o">O</label>
                                            <input type="radio" name="index" id="index-p" value=".index-p"><label for="index-p">P</label>
                                            <input type="radio" name="index" id="index-q" value=".index-q"><label for="index-q">Q</label>
                                            <input type="radio" name="index" id="index-r" value=".index-r"><label for="index-r">R</label>
                                            <input type="radio" name="index" id="index-s" value=".index-s"><label for="index-s">S</label>
                                            <input type="radio" name="index" id="index-t" value=".index-t"><label for="index-t">T</label>
                                            <input type="radio" name="index" id="index-u" value=".index-u"><label for="index-u">U</label>
                                            <input type="radio" name="index" id="index-v" value=".index-v"><label for="index-v">V</label>
                                            <input type="radio" name="index" id="index-w" value=".index-w"><label for="index-w">W</label>
                                            <input type="radio" name="index" id="index-x" value=".index-x"><label for="index-x">X</label>
                                            <input type="radio" name="index" id="index-y" value=".index-y"><label for="index-y">Y</label>
                                            <input type="radio" name="index" id="index-z" value=".index-z"><label for="index-z">Z</label>
                                            <input type="radio" name="index" id="index-all" value="*"><label for="index-all">All</label>
                                        </span>
                                        <hr />
                                        <span class="buttonset" id="isotope-contacts-sort">
                                            <input type="radio" name="sort" id="sort-firstname" value="fullname" checked="checked"><label for="sort-firstname">First Name</label>      
                                            <input type="radio" name="sort" id="sort-lastname" value="name"><label for="sort-lastname">Last Name</label>      
                                            <input type="radio" name="sort" id="sort-bday" value="bday"><label for="sort-bday">Birthday</label>
                                        </span>
   
                                    </div>
                                    
                                    <section>
                                        <ul class="isotope-contacts clearfix">
                                        <asp:Repeater ID="rptContacts" runat="server">
                                            <ItemTemplate>
                                                <li class="button-blue ui-corner-all index-<%#Eval("CharIndex") %>">
                                                    <div class="photo"><div></div></div>
                                                    <div class="fullname"><a href="customdetail.aspx?id=<%#Eval("CustomID") %>" class="zoombox"><%#Eval("FullName") %></a></div>
                                                    <div class="city">City: <%#Eval("City")%></div>
                                                    <div class="email">Email: <%#Eval("Email")%></div>
                                                    <div class="bday">Birthday: <%#Eval("Birthday","{0:yyyy-M-d}")%></div>
                                                </li>
                                            </ItemTemplate>
                                        </asp:Repeater>
                                                                                   
                                        </ul>
                                    </section>
                                </div>
                            </div>
                            
                        
                       <section class="container_6 clearfix">       
                        <div class="grid_6">

                                
                                <asp:GridView ID="gridView" CssClass="display" runat="server" AllowPaging="True" Width="100%" CellPadding="3"  OnPageIndexChanging ="gridView_PageIndexChanging"
                    BorderWidth="1px" DataKeyNames="" OnRowDataBound="gridView_RowDataBound"
                    AutoGenerateColumns="false" PageSize="100"  RowStyle-HorizontalAlign="Center" OnRowCreated="gridView_OnRowCreated">

                    <Columns>
                    
                            
		<asp:BoundField DataField="CustomID" HeaderText="CustomID" ReadOnly="false" Visible="false" /> 
		<asp:HyperLinkField HeaderText="CustomName" DataNavigateUrlFields="CustomID" DataNavigateUrlFormatString="customdetail.aspx?id={0}" ItemStyle-CssClass="zoombox"
                                DataTextField="FullName" />
		<asp:BoundField DataField="ShowSex" HeaderText="Gender" /> 
		<asp:BoundField DataField="Age" HeaderText="Age"   /> 
		<asp:BoundField DataField="Email" HeaderText="Email"   /> 
		<asp:BoundField DataField="Telphone" HeaderText="Telphone" /> 
		<asp:BoundField DataField="City" HeaderText="City"   /> 

                            
                          
                            <asp:HyperLinkField HeaderText="Edit"   DataNavigateUrlFields="CustomID" DataNavigateUrlFormatString="customupdate.aspx?id={0}"
                                Text="Edit"  />
                            <%--<asp:HyperLinkField HeaderText="Delete" DataNavigateUrlFields="CustomID" DataNavigateUrlFormatString="Show.aspx?id={0}"
                                                            Text="Delete"  />--%>
                        </Columns>
                </asp:GridView>
                            </div>
                       </section>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="SideBar" runat="server">
    <nav>
    <a class="chevron" href="#">&raquo;</a>
    <ul>
         <li><a href="customadd.aspx">New Contacts</a></li>
         <li class="current"><a href="contacts.aspx">My Contacts</a></li>
        <li><a href="customlist.aspx">Other Contacts</a></li><!-- 公共联系人-->

    </ul>
</nav>
</asp:Content>
